import { otherIcon } from "@/utils/SvgIcons.ts";

import { defineAsyncComponent } from "vue";
const commonConfig = {
  // 加载异步组件时使用的组件
  // loadingComponent: LoadingComponent,
  // errorComponent: ErrorComponent,
  delay: 200,
  timeout: 3000,
};

const DrawDetail = defineAsyncComponent({
  loader: () => import("./DrawDetail.vue"),
  ...commonConfig,
});
const References = defineAsyncComponent({
  loader: () => import("./References.vue"),
  ...commonConfig,
});
const EnterData = defineAsyncComponent({
  loader: () => import("./EnterData.vue"),
  ...commonConfig,
});
const ProcessData = defineAsyncComponent({
  loader: () => import("./ProcessData.vue"),
  ...commonConfig,
});
const OutPutData = defineAsyncComponent({
  loader: () => import("./OutPutData.vue"),
  ...commonConfig,
});
const Deliverables = defineAsyncComponent({
  loader: () => import("./Deliverables.vue"),
  ...commonConfig,
});
const Subtask = defineAsyncComponent({
  loader: () => import("./Subtask.vue"),
  ...commonConfig,
});
const RelatedTasks = defineAsyncComponent({
  loader: () => import("./RelatedTasks.vue"),
  ...commonConfig,
});
const LifeCycle = defineAsyncComponent({
  loader: () => import("./LifeCycle.vue"),
  ...commonConfig,
});

export const componentsList = {
  DrawDetail,
  References,
  EnterData,
  ProcessData,
  OutPutData,
  Deliverables,
  Subtask,
  RelatedTasks,
  LifeCycle,
};

export const AllTabs = [
  {
    id: 1,
    title: "详情",
    icon: otherIcon,
    closable: false,
    type: "DrawDetail",
  },
  {
    id: 8,
    title: "参考资料",
    icon: otherIcon,
    closable: false,
    type: "References",
  },
  {
    id: 2,
    title: "输入数据",
    icon: otherIcon,
    closable: false,
    type: "EnterData",
  },
  {
    id: 3,
    title: "过程数据",
    icon: otherIcon,
    closable: false,
    type: "ProcessData",
  },
  {
    id: 4,
    title: "输出数据",
    icon: otherIcon,
    closable: false,
    type: "OutPutData",
  },
  {
    id: 5,
    title: "交付物",
    icon: otherIcon,
    closable: false,
    type: "Deliverables",
  },
  {
    id: 6,
    title: "子任务",
    icon: otherIcon,
    closable: false,
    type: "Subtask",
  },
  {
    id: 7,
    title: "相关任务",
    icon: otherIcon,
    closable: false,
    type: "RelatedTasks",
  },
  // {
  //   id: 11,
  //   title: "生命周期",
  //   icon: otherIcon,
  //   closable: false,
  //   type: "LifeCycle",
  // },

  // {
  //   id: 9,
  //   title: "动态",
  //   icon: otherIcon,
  //   closable: false,
  // },
  // {
  //   id: 10,
  //   title: "评论",
  //   icon: otherIcon,
  //   closable: false,
  // },
];

export const statusOptions = [
  { value: "已完成", label: "已完成", tag: "已完成" },
  { value: "进行中", label: "进行中", tag: "进行中" },
  { value: "未开始", label: "未开始", tag: "未开始" },
];

export const formDataCustom = [
  { id: 2, name: "任务编号", field: "code", type: "text", invisible: true },
  {
    id: 31,
    name: "任务类型",
    field: "taskTypeId",
    type: "user",
    invisible: true,
  },
  { id: 27, name: "优先级", field: "priority", type: "tag", invisible: true },
  {
    id: 30,
    name: "任务进度",
    field: "lifecycleCurrentNode",
    type: "progress",
    invisible: true,
  },
  {
    id: 130,
    name: "里程碑",
    field: "isMilestone",
    type: "switch",
    invisible: true,
  },

  { id: 29, name: "负责人", field: "curator", type: "user", invisible: true },
  {
    id: 7,
    name: "执行人",
    field: "memberVOList",
    type: "text",
    invisible: true,
  },
  {
    id: 16,
    name: "计划日期",
    field: "plannedStartTime",
    type: "date",
    invisible: true,
  },
  {
    id: 116,
    name: "计划工期",
    field: "plannedDurationDay",
    type: "text",
    invisible: true,
  },
  {
    id: 216,
    name: "实际日期",
    field: "actualEndTime",
    type: "date",
    invisible: true,
  },
  {
    id: 216,
    name: "实际工期",
    field: "actualHours",
    type: "text",
    invisible: true,
  },
  {
    id: 316,
    name: "仿真工况",
    field: "like",
    type: "input",
    invisible: true,
  },
];

export const TypeMap = {
  UPLOAD: "本地上传",
  INTERNAL: "内部上传",
  EXTERNAL: "外部上传",
};
